#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Dev.MicroService.ServiceInstanceMinimalAPI/Dev.MicroService.ServiceInstanceMinimalAPI.csproj", "Dev.MicroService.ServiceInstanceMinimalAPI/"]
COPY ["Dev.MicroService.Interface/Dev.MicroService.Interface.csproj", "Dev.MicroService.Interface/"]
COPY ["Dev.MicroService.Model/Dev.MicroService.Model.csproj", "Dev.MicroService.Model/"]
COPY ["Dev.MicroService.Service/Dev.MicroService.Service.csproj", "Dev.MicroService.Service/"]
COPY ["Dev.MicroService.Framework/Dev.MicroService.Framework.csproj", "Dev.MicroService.Framework/"]
RUN dotnet restore "Dev.MicroService.ServiceInstanceMinimalAPI/Dev.MicroService.ServiceInstanceMinimalAPI.csproj"
COPY . .
WORKDIR "/src/Dev.MicroService.ServiceInstanceMinimalAPI"
RUN dotnet build "Dev.MicroService.ServiceInstanceMinimalAPI.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Dev.MicroService.ServiceInstanceMinimalAPI.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Dev.MicroService.ServiceInstanceMinimalAPI.dll"]